package com.ldj.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * User: ldj
 * Date: 2023/5/4
 * Time: 12:44
 * Description: No Description
 */
@Slf4j
@Component
@RocketMQMessageListener(
        consumerGroup = "my-boot-consumer-group1",
        topic = "my-boot-topic",
        selectorType = SelectorType.TAG,
        selectorExpression = "*")
public class MyConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("[Rocketmq] 收到消息: " + message);
    }

}
